#ifndef H_ANALYSIS
#define H_ANALYSIS

#ifdef __cplusplus
extern "C" {
#endif

#include<stdint.h>

int single_time_step(int nstep, int astep, int num_ensemble);

void all_dist(float *dist_pardump, float *dist_cdump, float *dist_datem,
    float *xb_tlat, float *xb_tlon, float *zlvl, float *yb_clat, float *yb_clon, float *obs_lat, float *obs_lon, int numpar, int numline, int numobs);

int find_neighbors(int i, int radius, int num_ensemble, int numpar, int numline, int numobs, double *xb_bar, double *yb_bar, double **en_mass, double **en_con, double *obs, double *localxb_bar, double *localyb_bar, double **localXb, double **localYb, double *localobs, double *localR, int *len_r, float *dist_pardump, float *dist_cdump, float *dist_datem, double valid_dist);

int find_min_dist(float *dist_array, int pos, int sizex, int sizey);

void init_guess(int num_ensemble);

void small_sort_dist(float *numbers, int *pos, int array_size);

void siftDown(float *numbers, int *pos, int root, int bottom);

#ifdef __cplusplus
}
#endif

#endif
